package notify_all

import (
	"fmt"
	"gitee.com/zaper/service-config/constant"
	"gitee.com/zaper/service-config/service/comm_handler"
	"gitee.com/zaper/service-config/service/service_register"
	clientv3 "go.etcd.io/etcd/client/v3"
	"time"
)

func AllConfigNotifySchedule() {
	ticker := time.NewTicker(15 * time.Minute)
	key := fmt.Sprintf("/%s", constant.ConfigName)
	for {
		select {
		case <-ticker.C:
			comm_handler.ChangeHandler(key, constant.ConfigName, service_register.GetServiceIdList(),
				clientv3.WithPrefix())
		}
	}
}
